home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8199 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: stc06.ctd.ornl.gov!msr!kennel
  2. From: kennel@msr.epm.ornl.gov (Matt Kennel)
  3. Newsgroups: comp.lang.c++,comp.lang.c
  4. Subject: Re: Performance: C vs. C++
  5. Followup-To: comp.lang.c++,comp.lang.c
  6. Date: 15 Feb 1996 17:41:08 GMT
  7. Organization: Oak Ridge National Lab, Oak Ridge, TN
  8. Message-ID: <4fvr7k$a3l@stc06.ctd.ornl.gov>
  9. References: <30F6BAAC.12B5@iastate.edu> <4da9pn$a45@news.bridge.net> <4dnpl2$c8g@classic.iinet.com.au> <3105E9DC.1BE3@enermet.fi> <DLr46y.7rH@txnews.amd.com> <4elk5l$3f2q@yuma.ACNS.ColoState.EDU> <pronet01.31.003EB1E6@indirect.com> <3117F980.7890@hpato.aus.hp.com> <4fgd62$asb@gaia.ns.utk.edu> <4frur0$73t@adam.telalink.net>
  10. NNTP-Posting-Host: msr.epm.ornl.gov
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. >David Rawle (daver@nashville.net) wrote:
  14. (Actually it was me) 
  15. > >
  16. > >                1)  A linguistic mechanism to say "this is not a 
  17. > dispatched
  18. > >                    pointer".  I think it's a flaw to forcibly connect
  19. > >                    reference semantics with dispatchability. 
  20. > >
  21.  
  22. > What is a "dispatched pointer"?
  23.  
  24. In C++ it would be a pointer to a base class which has 'virtual members',
  25. where the particular function called is chosen by the actual run-time 
  26. type. 
  27.  
  28. In C++, if you have a pointer, then it is always conceivably dispatched,
  29. unless everything in the class is declared "static".   
  30.  
  31. So here "reference semantics" (going through a pointer, a storage area 
  32. potentially aliased) are joined with "dispatchability".
  33.  
  34. I personally prefer langauges where the *user* of the pointer can say:
  35.  
  36.     This is a pointer to class X or any of its compatible descendents. 
  37.     This is a pointer to exactly class X. 
  38.  
  39. (viz Sather)
  40.  
  41. cheers
  42. Matt
  43.  
  44.